package com.easonji.common.constant.enums;

/**
 * @ClassName: UserStatusEnum
 * @Description: 管理员的状态
 * @Author: LiuJun
 * @date: 2018/07/29 14:59
 * @Version: 1.0
 * @Copyright: Copyright (c) 2018 - 2019
 */
public enum UserStatusEnum {
    /**
     * 启用
     */
    OK(1, "启用"),
    /**
     * 冻结
     */
    FREEZED(2, "冻结"),
    /**
     * 被删除
     */
    DELETED(3, "被删除");

    private Integer code;

    private String message;

    UserStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String valueOf(Integer value) {
        if (value == null) {
            return "";
        } else {
            for (UserStatusEnum ms : UserStatusEnum.values()) {
                if (ms.getCode() == value) {
                    return ms.getMessage();
                }
            }
            return "";
        }
    }
}
